package com.example.applyforaid.controller;


import com.example.applyforaid.entity.*;
import com.example.applyforaid.mapper.ClothesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ATO3_W
 * @since 2021-06-16
 */
@RestController
@RequestMapping("/clothes")
public class ClothesController {

    @Autowired
    private ClothesMapper clothesMapper;

    //测试mapper
    @RequestMapping("/a")
    public String get() {
        ClothesExample clothesExample = new ClothesExample();
        ClothesExample.Criteria clothesExampleCriteria = clothesExample.createCriteria();
        clothesExampleCriteria.andClothesGenderEqualTo(true);
        List<Clothes> clothesList =clothesMapper.selectByExample(clothesExample);
        Clothes clothes = new Clothes();
        clothes.setClothesId("3");
        try {
            String s = Integer.toString(clothesMapper.insert(clothes));
        }
        catch (Exception e)
        {
            System.out.println("WSZZY\n\n\n\n\n");
        }
        finally {
            Clothes clothes1 = new Clothes();
            clothes1.setClothesId("5");
            System.err.println(clothesMapper.insert(clothes1));
            System.out.println("xxxxxx");
        }

        return null;
    }
}

